package top.eggcode.component.query;

import javax.persistence.EntityManager;

/**
 * Title: SQL 标准构造器
 * Description: 用 Java 的方式编写 SQL 语句
 * 这个版本只支持 select 子句
 * Date: 2021/8/7 1:02
 *
 * @author JiaQi Ding
 * @version 1.0
 */
public class CriteriaBuilder {

    private final EntityManager manager;


    public CriteriaBuilder(EntityManager manager) {
        this.manager = manager;
    }


    public EntityManager getManager() {
        return manager;
    }

    public <T> QueryWrapper<T> createQuery(Class<T> resultClass) {
        return new QueryWrapper<>(this, resultClass);
    }
}
